<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>垂直居中</title>
    <style>
        img {
            /* width: 530px;
            height: 254px; */
            position: absolute;
            top: 50%;
            left: 50%;
            /* margin-top: -127px;
            margin-left: -265px; */

            /* 位移自动计算 */
            transform: translate(-50%, -50%);
        }
    </style>
</head>

<body>
    <img src="../day07/img/login.webp" alt="">
</body>

</html>